<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var arr=[];
    var a=arr.push(Math.floor(Math.random()*(60-20+1)+20))
    for(i=0;i<10;i++){
        if(arr.indexOf(a)==-1){
            arr.push(a)
        }else{
            i--;
        }
    }
    arr.sort(function(a,b){
        return a-b
    })
    console.log(arr);
    
    
</script>